#include <stdio.h>
#include <string.h>
#include <conio.h>

int str_len(char *);
void str_cpy(char *,char *);
void str_cat(char *,char *);
int str_cmp(char *,char *);

void main()
	{
	 char *ss="mynameisdxj";
	 char *dd="hernameislxx";
	 char temp[20];
	 int len,cmp;
	 clrscr();
         len=str_len(ss);
         str_cpy(ss,temp);   cmp=str_cmp(ss,dd);
         str_cat(ss,dd);

         printf("\nThe len of *ss is %d\n",len);
         printf("str_cpy result is temp is %s\n",temp);
         printf("str_cmp result is %d\n",cmp);
	 printf("str_cat result is %s\n",ss);
	 }

int str_len(char *ss)
	{
	 int i=0;
	 while(*ss++) i++;
	 return i;
	 }

void str_cpy(char *ss,char *dd)
	{
	 int temp;
	 while(*ss)
		{ temp=*ss++;
		  *dd++=temp;
		 }
	 *dd=0;}

int str_cmp(char *ss,char *dd)
	{

	 int s;
	 while(1)
		{ s=*ss++ - *dd++;
		  if(*ss==0 && *dd==0) break;
		}
	 return s;
	 }

void str_cat(char *ss,char *dd)
	{
	 int i;
	 i=strlen(ss);
	 ss+=i;
	 while(*dd)
		{*ss++=*dd++;}
	 *ss=0;
	 }